import RouterConfig from './router/index.jsx';
import { Layout } from 'antd';
import NavHeader from './components/NavHeader.jsx';
import { useState } from 'react';
import LoginForm from './components/LoginForm.jsx';
import PageFooter from './components/PageFooter.jsx';

const { Header, Footer, Content } = Layout;

function App() {
  const [isModalOpen, setIsModalOpen] = useState(false);

  function closeModal() {
    setIsModalOpen(false);
  }

  function loginHandle() {
    setIsModalOpen(true);
    console.log('login1');
  }

  return (
    <>
      <Layout>
        <Header>
          <NavHeader loginHandle={loginHandle} />
        </Header>
        <Content className="container bg-white mt-3">
          <RouterConfig />
        </Content>
        <Footer>
          <PageFooter />
        </Footer>
      </Layout>
      <LoginForm isShow={isModalOpen} closeModal={closeModal} />
    </>
  );
}

export default App;
